package com.linghui.videoplus.ipai.activity;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ListView;

import com.linghui.videoplus.ipai.R;
import com.linghui.videoplus.ipai.adapter.MessageBoxAdapter;
import com.linghui.videoplus.ipai.api.db.VideoPlusDB;
import com.linghui.videoplus.ipai.bean.MessageBean;

public class MessageBoxActivity extends BaseActivity {
	private ListView listView = null;
	private MessageBoxAdapter mAdapter=null;
	private List<MessageBean> list=new ArrayList<MessageBean>();

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_message);
		listView=(ListView)findViewById(R.id.msgListView);
		fillMessageView();
	}
	
	private void fillMessageView(){
		VideoPlusDB vDB=new VideoPlusDB(this);
		list=vDB.listMessage();
		vDB.closeDb();
		mAdapter=new MessageBoxAdapter(this, list);
		listView.setAdapter(mAdapter);
	}
	
	
	public static void lanuch(Activity mActivity){
		Intent it=new Intent(mActivity,MessageBoxActivity.class);
		mActivity.startActivity(it);
		mActivity.finish();
	}
}
